package LeetCode;

/**
 * @author VX5
 * @Title: MJC
 * @ProjectName DataStructure
 * @Description: TODO
 * @date ${DAT}15:22
 */
public class interview65 {

    public static void main(String[] args) {
        System.out.println(add(1, 1));;
    }

    public static int add(int a, int b) {
        while (b != 0){
            int tempSum = a ^ b;
            int carrySum = (a & b) << 1;
            a = tempSum;
            b = carrySum;
        }
        return a;
    }
}
